<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!--{include file='comm/header.tpl'}-->
    <title>商品咨询处理</title>
<style>
	.widefat {
		border-color: #dfdfdf;
		background-color: #f9f9f9;
	}
	.widget .widget-top,.widefat thead tr th,.widefat tfoot tr th {
		background-color: #f1f1f1;
		background-image: -ms-linear-gradient(top,#f9f9f9,#ececec);
		background-image: -moz-linear-gradient(top,#f9f9f9,#ececec);
		background-image: -o-linear-gradient(top,#f9f9f9,#ececec);
		background-image: -webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#ececec));
		background-image: -webkit-linear-gradient(top,#f9f9f9,#ececec);
		background-image: linear-gradient(top,#f9f9f9,#ececec);
	}
	
	.widefat td,.widefat th {
		border-top-color: #fff;
		border-bottom-color: #dfdfdf;
	}
	.widefat th {
		text-shadow: rgba(255,255,255,0.8) 0 1px 0;
	}
	
	#contentForm {
		font-family: sans-serif;
		font-size: 13px;
	}
	.widefat {
		border-width: 1px;
		border-style: solid;
		border-spacing: 0;
		width: 100%;
		clear: both;
		margin: 0;
		-moz-border-radius: 3px;
		-khtml-border-radius: 3px;
		-webkit-border-radius: 3px;
		border-radius: 3px;
	}
	
	.widefat td,.widefat th {
		border-width: 1px 0;
		border-style: solid;
	}
	.widefat tfoot th {
		border-bottom: none;
	}
	.widefat .no-items td {
		border-bottom-width: 0;
	}
	.widefat td {
		font-size: 12px;
		padding: 4px 7px 2px;
		vertical-align: top;
	}
	.widefat td p,.widefat td ol,.widefat td ul {
		font-size: 12px;
	}
	.widefat th {
		padding: 7px 7px 8px;
		text-align: left;
		line-height: 1.3em;
		font-size: 14px;
	}
	#content {
		border:1px solid #DFDFDF;
		font-size:12px;
		height:100%;
		line-height:150%;
		margin:0;
		outline:medium none;
		padding:0;
		width:100%;
	}
	.commentInfo{
		font-size:14px;
		border:1px solid #DFDFDF;
		padding:3px 0px 3px 5px;
		background-color:#EEEEEE;
		margin-bottom:5px;
		-moz-border-radius:3px 3px 3px 3px;
	}
</style>
</head>
<body>
<div style="width:100%">

    <div class="items clearfix">

        <h2 style="" class="tal">正在操作：处理商品咨询</h2>

        <div class="items2">

            <!--{if $error_msg}-->

            <div class="error-box">
                <!--{$error_msg}-->
            </div>

            <!--{else}-->

            <div>
                <form id="consult_form" onsubmit="return false;">
                	<table cellspacing="0" class="widefat fixed comments" style="width:80%;margin:0px auto;border:1px">
					    <thead>
					        <tr>
					            <th style="" class="manage-column column-author sortable desc" id="author"scope="col">
					                <span>会员</span>  
					                <span class="sorting-indicator" />      
					            </th>
					            <th style="" class="manage-column column-comment" id="comment" scope="col">
					                咨询
					            </th>
					        </tr>
					    </thead>
					    <tbody class="list:comment" id="the-comment-list">
					        <tr class="approved" id="comment-2">
					            <td class="author column-author" style="width:25%;">
					             	<b><!--{$consultData->creator}--></b>
									<p style="margin-top:10px;"/>
									<font style="color:#777777;">IP地址：</font> 
									<font color="#21759b"><!--{$consultData->ipAddress}--></font>		           
					            </td>  
					            <td class="comment column-comment" style="width:75%;">
					                <div class="submitted-on">
					                  	<font style="color:#777777;">提交于</font>
					                    <font color="#21759B"><!--{$consultData->createTime}--></font> 
					                    <font style="color:#777777;">| 咨询</font>
					                    <!--{if $consultData->goodsLink != ""}-->
						                    <a href="<!--{$consultData->goodsLink}-->" target="_blank">
												<b><!--{$consultData->goodsName}--></b>
											</a> 
										<!--{else}-->
											<b><!--{$consultData->goodsName}--></b> 
										<!--{/if}-->
					                   <p/>&nbsp;<p/>
					                  	<div class="commentInfo">
					                  		<!--{$consultData->consultInfo}-->
					                    </div>
					                </div>
					    		</td>
					        </tr>
					        <tr id="replyrow">
							    <td class="colspanchange" colspan="4" style="background-color:#F1F1F1;">
							        <div style="height:25px;" id="replyhead">
							           <b>咨询回复</b>
							        </div>
							        <div style="text-align:center;">
										<textarea style="width:100%;height:120px;" name="content" id="content"><!--{$consultData->answerInfo}--></textarea>
										<input type="hidden" name="uuid" id="uuid" value="<!--{$consultData->uuid}-->">
									</div>
							    </td>
							</tr>
							<tr id="replyrow">
							    <td class="colspanchange" colspan="4" style="background-color:#F1F1F1;">
							        网站显示控制:
									<!--{if $consultData->displayFlg == 1 || $consultData->displayFlg == null}-->
										<input type="radio" value="0" name="displayFlg">仅咨询人可见 
										<input type="radio" value="1" name="displayFlg" checked>所有人可见 
									<!--{else}-->
										<input type="radio" value="0" name="displayFlg" checked>仅咨询人可见 
										<input type="radio" value="1" name="displayFlg">所有人可见 
									<!--{/if}-->
							    </td>
							</tr>
							<tr id="replyrow" style="display:none;">
							    <td class="colspanchange" colspan="4" style="background-color:#F1F1F1;">
							       首页推荐:
									<!--{if $consultData->recommendFlg == 1}-->
										<input type="radio" value="0" name="recommendFlg">不推荐
										<input type="radio" value="1"  name="recommendFlg" checked>推荐
									<!--{else}-->
										<input type="radio" value="0" name="recommendFlg" checked>不推荐
										<input type="radio" value="1"  name="recommendFlg">推荐
									<!--{/if}-->
							    </td>
							</tr>
					    </tbody>
					</table>
                </form>
            </div>

            <!--{/if}-->

        </div>
    </div>


    <div class="bottom_fixbox">
        <div class="rectbox tac">
            <input type="button" class="btn" onclick="goodsConsult.check();" value="处理" />&nbsp;&nbsp;&nbsp;
            <input type="button" class="btn" onclick="E.closeWindows();" value="关闭" />
        </div>
    </div>

</div>

<script type="text/javascript">

    var goodsConsult = {

        category_id: <!--{$category_id|default:0}-->,

        //检查数据
        check: function() {
            this.dt = E.getFormValues("consult_form");
            var error_msg = "";
            if (this.dt.content == "") {
            	error_msg += '咨询回复不能为空<br />';
            }
			            	
            if (error_msg != "")
                E.alert(error_msg);
            else
                E.confirm("您确认处理此商品咨询吗", "goodsConsult.add");
        },
		
        //处理商品咨询
        add: function() {
            $.ajax({
                type: "POST",
                url: "/invokingAjax-backend/content/goodsConsult.ajax?operFlg=3",
                dataType: "JSON",
                data: this.dt,
                success: function( result_obj ) {
                    if (result_obj.code == 200) {
                        E.opener("goodsConsult.load");
                        E.alert(result_obj.message, 2, "E.closeWindows");
                    } else {
                        E.alert(result_obj.message);
                    }
                }
            });
        }
    };
	
</script>

</body>

</html>